package com.ssy.lingxi.product.api.enums;

import java.util.Arrays;

/**
* 单据类型枚举类
* @author wrc
* @date 2020/12/21
*/
public enum InvoicesTypeModelEnum {



    /**
     * 采购入库单
     */
    PLATFORM_MEMBER_VERIFY("purchaseInvoices","S001", "采购入库单"),
    /**
     * 销售发货单
     */
    SALES_INVOICE("saleInvoices","S002", "销售发货单"),
    /**
     * 加工入库单
     */
    PROCESSING_STOCK_IN("processingStockIn","S003", "加工入库单"),
    /**
     * 加工发货单
     */
    PROCESSING_INVOICE("processingInvoice","S004", "加工发货单"),
    /**
     *
     * 退货发货单
     */
    RETURN_INVOICE("returnInvoice","S005", "退货发货单"),
    /**
     * 退货入库单
     */
    RETURN_STOCK_IN("returnStockIn","S006", "退货入库单"),
    /**
     *
     *换货发货单
     */
    EXCHANGE_INVOICE("exchangeInvoice","S007", "换货发货单"),
    /**
     * 换货入库单
     */
    STOCK_REPLACEMENT("stockReplacement","S008", "换货入库单"),
    /**
     * Hcx采购入库单
     */
    HCX_PURCHASE_STOCK_IN("hcxPurchaseStockIn","H001", "Hcx采购入库单"),
    /**
     * Hcx销售发货单
     */
    HCX_SALES_INVOICE("hcxSalesInvoice","H002", "Hcx销售发货单"),

    /**
     * 售后换货退货发货单
     */
    ADD_RETURN_SHIPMENT("addReturnShipment","H003", "换货退货发货单"),
    /**
     * 售后换货退货入库单
     */
    ADD_A_GOODS_RETURN_WAREHOUSING_DOCUMENT("addDoodsReturnWarehousingDocument","H004", "换货退货入库单"),
    ;

    /**
     * 服务名字
     */
    private String serviceName;


    /**
     * 单据类型枚举code
     */
    private String typeCode;

    /**
     * 单据类型名字
     */
    private String name;



    public static String getServiceName(String typeCode) {
        InvoicesTypeModelEnum orderWorkEnum = Arrays.stream(InvoicesTypeModelEnum.values()).filter(v -> v.getTypeCode().equals(typeCode)).findAny().orElse(null);
        return null == orderWorkEnum ? "" : orderWorkEnum.serviceName;
    }



    InvoicesTypeModelEnum() {
    }

    InvoicesTypeModelEnum(String serviceName, String typeCode, String name) {
        this.serviceName = serviceName;
        this.typeCode = typeCode;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public String getTypeCode() {
        return typeCode;
    }

    public void setTypeCode(String typeCode) {
        this.typeCode = typeCode;
    }
}
